package com.study.zouchao.superproject.myreceivedtask.model;

import com.study.zouchao.superproject.base_zou.api_zou.Api_C;
import com.study.zouchao.superproject.myreceivedtask.model.entity.FinishResult;
import com.study.zouchao.superproject.myreceivedtask.model.entity.MyReceivedTaskListResult;
import com.study.zouchao.superproject.util.RxSchedulers;
import com.study.zouchao.superproject.util.api.api.Api;

import java.util.Map;

import rx.Observable;

/**
 * Created by Administrator on 2017/6/20.
 */

public class MyReceivedTaskListModel {

    /*
     *  真正的接口
     * @param params
     * @return
     */
    public Observable<MyReceivedTaskListResult> listMyReceivedTaskList(Map<String, String> params) {
        return Api.getInstance(Api_C.BASE_URL_LIN_BASE).mApiService
                .listMyReceivedTaskByPOST(params)
//                .map(RxSchedulers.<TravelListResult>sleep(3000))
                .compose(RxSchedulers.<MyReceivedTaskListResult>io_main());
    }



    /*
     *  真正的接口
     * @param params
     * @return
     */
    public Observable<FinishResult> finishTask(Map<String, String> params) {
        return Api.getInstance(Api_C.BASE_URL_LIN_BASE).mApiService
                .finishTaskByPOST(params)
                .compose(RxSchedulers.<FinishResult>io_main());
    }

//    public Observable<MyPublishTaskListResult> listTaskList(Map<String, String> params) {
//        return Observable.just(getTestResult())
////                .map(RxSchedulers.<TravelListResult>sleep(3000))
//                .compose(RxSchedulers.<MyPublishTaskListResult>io_main());
//    }

//    private MyPublishTaskListResult getTestResult() {
//        MyPublishTaskListResult result = new MyPublishTaskListResult();
//        List<MyPublishTaskListResult.MyPublishTaskItemBean> data = new ArrayList<>();
//        MyPublishTaskListResult.MyPublishTaskItemBean bean1 = new MyPublishTaskListResult.MyPublishTaskItemBean(21, "https://www.baidu.com/img/bd_logo1.png", "zouchao", 15, "2017", "reward..", 52, "需要帮助", 1);
//        MyPublishTaskListResult.MyPublishTaskItemBean bean2 = new MyPublishTaskListResult.MyPublishTaskItemBean(21, "https://www.baidu.com/img/bd_logo1.png", "zouchao", 15, "2017", "reward..", 52, "需要帮助", 1);
//        MyPublishTaskListResult.MyPublishTaskItemBean bean3 = new MyPublishTaskListResult.MyPublishTaskItemBean(21, "https://www.baidu.com/img/bd_logo1.png", "zouchao", 15, "2017", "reward..", 52, "需要帮助", 1);
//        MyPublishTaskListResult.MyPublishTaskItemBean bean4 = new MyPublishTaskListResult.MyPublishTaskItemBean(21, "https://www.baidu.com/img/bd_logo1.png", "zouchao", 15, "2017", "reward..", 52, "需要帮助", 1);
//        MyPublishTaskListResult.MyPublishTaskItemBean bean5 = new MyPublishTaskListResult.MyPublishTaskItemBean(21, "https://www.baidu.com/img/bd_logo1.png", "zouchao", 15, "2017", "reward..", 52, "需要帮助", 1);
//        MyPublishTaskListResult.MyPublishTaskItemBean bean6 = new MyPublishTaskListResult.MyPublishTaskItemBean(21, "https://www.baidu.com/img/bd_logo1.png", "zouchao", 15, "2017", "reward..", 52, "需要帮助", 1);
//        data.add(bean1);
//        data.add(bean2);
//        data.add(bean3);
//        data.add(bean4);
//        data.add(bean5);
//        data.add(bean6);
//        result.setPageSize(1000);
//        result.setData(data);
//        return result;
//    }
}
